#include "wyzkr688rfswinstance_global.h"
#include "wyzkr688rfswinstance.h"


static WyZkR688RFSWInstance* pInstance = nullptr;

short PLU_FswTecPluginInstanceCreate(short Local_Remote){
    if(pInstance == nullptr) pInstance = new WyZkR688RFSWInstance(Local_Remote);
    return NOERROR;
}
short PLU_FswTecPluginInstanceDelete(){
    if(pInstance != nullptr) delete pInstance;
    return NOERROR;
}
bool PLU_FswTecPluginInstanceExists(){
    if(pInstance != nullptr) return true;
    else                     return false;
}

QWidget* PLU_FswTecPluginInstanceUiRegesiter(){
    if(pInstance != nullptr){
        return pInstance->getUiHandle();
    }
    else{
        return nullptr;
    }
}

void TASK_uifast_UiDataUpdate(){
    if(pInstance != nullptr){
        pInstance->task_uifast_UiDataUpdate();
    }
}
void TASK_uifast_ForceScopeUpdate(){
    if(pInstance != nullptr){
        pInstance->task_uifast_ForceScopeUpdate();
    }
}
void TASK_uifast_RobotScopeUpdate(){
    if(pInstance != nullptr){
        pInstance->task_uifast_RobotScopeUpdate();
    }
}

void TASK_maininit_toRobotTcpServerAdd(){
    if(pInstance != nullptr){
        pInstance->task_maininit_toRobotTcpServerAdd();
    }
}
void TASK_maininit_toRobotTcpServerListen(){
    if(pInstance != nullptr){
        pInstance->task_maininit_toRobotTcpServerListen();
    }
}

void TASK_mainloop_toRobotReceiveLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toRobotReceiveLoopRun();
    }
}

void TASK_mainloop_toRobotSendLoopRun(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_toRobotSendLoopRun();
    }
}

void TASK_RemoteDataRecv(QByteArray Data){
    if(pInstance != nullptr){
        pInstance->task_com_RemoteDataRecv(Data);
    }
}
void TASK_RemoteDataSend(QByteArray& Data){
    if(pInstance != nullptr){
        pInstance->task_com_RemoteDataSend(Data);
    }
}

void TASK_mainloop_ProcessDataSave(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_ProcessDataSave();
    }
}

void TASK_mainloop_RfswProcessDeal(){
    if(pInstance != nullptr){
        pInstance->task_mainloop_RfswProcessDeal();
    }
}
